package com.cheer.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cheer.entity.ExPresentAudioCountEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * 用户信息
 *
 * @author cheer
 */
@Mapper
@Repository
public interface ExPresentAudioCountDao extends BaseMapper<ExPresentAudioCountEntity> {

    default ExPresentAudioCountEntity selectOne() {
        return selectOne(new QueryWrapper<ExPresentAudioCountEntity>().last("limit 1"));
    }

    void decrTotalCount();

    void decrTotalCountAndUserCount();

    void decr(@Param("total") Integer total, @Param("totalUser") Integer totalUser,
              @Param("good") Integer good, @Param("goodUser") Integer goodUser);

    void selectOneByUserId(Integer id, Integer userId);

    void incrTotalCountAndUserCount();

    void incrTotalCount();
}
